package com.briup.day24;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;

public class Test_InputStreamReader {
    public static void main(String[] args) throws Exception {
        //将字节输入流转为字符输入流并指定字符集
        InputStreamReader isr = new InputStreamReader(new FileInputStream("01-Basic/src/dir/GBK.txt"),"GBK");
        int len;
        char[] buf = new char[8];
        while((len=isr.read(buf))!=-1){
            System.out.print(new String(buf,0,len));
        }
        isr.close();
    }
}
